<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>requestAnimationFrame</title>
</head>
<body>
  <div id="status" style="background-color: red; height: 30px; width: 10px;"></div>
  <script>
    function updateProgress() {
      const div = document.getElementById('status');
      div.style.width = (parseInt(div.style.width, 10) + 5) + '%';
      if (div.style.left != '100%') {
        requestAnimationFrame(updateProgress);
      }
    }

    requestAnimationFrame(updateProgress);
  </script>
</body>
</html>